package com.taoge.biz.common.redis;

import com.taoge.biz.common.enums.SmsActionType;

/**
 * @className: SmsRedisKey
 * @description: 短信redis key
 * @author: YaoSiCheng
 * @date: 2024-08-28 15:49
 */
public class SmsRedisKey {

    private static final String PREFIX = "sms:";

    /**
     * @title: getSmsCountInDayKey
     * @description: 当天发送短信key
     * @date: 2024-08-28 15:51:29
     * @author: YaoSiCheng
     * @param: identity 业务标识
     * @param: smsActionType 业务类型
     * @param: date yyyyMMdd
     * @return: String
     */
    public static String getSmsCountInDayKey(String identity, SmsActionType smsActionType, String date) {
        return PREFIX + "count:" + identity + ":" + smsActionType.name() + ":" + date;
    }

    /**
     * @title: getSmsTotalInDayKey
     * @description: 当天发送总数key
     * @date: 2024-08-28 16:21:57
     * @author: YaoSiCheng
     * @param: date
     * @return: String
     */
    public static String getSmsTotalInDayKey(String date) {
        return PREFIX + "total:" + date;
    }
}
